import { createRouter, createWebHashHistory } from 'vue-router'

import Layout from '../views/Main.vue'
import Login from '../views/login/login.vue'
import profiles from '../views/profiles/profiles.vue'
import healthManange from '../views/officetable/healthManange/healthManange.vue'
import precaution from '../views/officetable/precaution/precaution.vue'
import AccountManagement from '../views/account/AccountManagement.vue'
import AIteacher from '../views/AI/AIteacher.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    name: 'main',
    children: [
      {
        path: 'profiles',
        meta: { id: '1', name: '画像管理', icon: 'Grid', path: '/profiles', describe: '教员可以管理所教班级的画像' },
        component: profiles
      },
      {
        path: 'officetable',
        meta: { id: '2', name: '办公台', icon: 'Platform' },
        children: [
          {
            path: 'healthManange',
            meta: { id: '1', name: '学生健康管理', icon: 'Avatar', path: '/officetable/healthManange', describe: '教员可以管理所教学生的健康问题' },
            component: healthManange,
          },
          {
            path: 'precaution',
            meta: { id: '2', name: '学业预警管理', icon: 'Avatar', path: '/officetable/precaution', describe: '教员可以管理所教学生的学业预警问题' },
            component: precaution,
          }
        ]
      },
      {
        path: 'AIteacher',
        meta: { id: '3', name: 'AI助教', icon: 'Avatar', path: '/AIteacher', describe: '教员可以管理所教班级的画像' },
        component: AIteacher,
      },
    ]
  },
  {
    path: '/AccountManagement',
    component: AccountManagement
  },
  {
    path: '/login',
    component: Login
  },
]

const router = createRouter({
  routes,
  history: createWebHashHistory(),
})

export default router